import 'package:flutter/material.dart';
import 'package:p_location/common/widget/tag_view.dart';

class TagViewGroup extends StatelessWidget {
  final List<String> tagList;

  TagViewGroup(this.tagList);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(left: 20, right: 10, top: 5, bottom: 10),
      child: Wrap(children: _getChildren()),
    );
  }

  _getChildren() {
    List<Widget> children = [];
    tagList.forEach((item) {
      children.add(TagView(
        item,
        marginTop: 5,
        marginRight: 5,
        paddingLeft: 10,
        paddingTop: 5,
        paddingRight: 10,
        paddingBottom: 5,
      ));
    });
    return children;
  }
}
